Skip to content

Feat: Reintroduce segmented fees - #455

Open
kinrezC wants to merge 2 commits into
mainfrom
feat/segmented-fees
Open

Feat: Reintroduce segmented fees#455
kinrezC wants to merge 2 commits into
mainfrom
feat/segmented-fees

Conversation

@kinrezC

@kinrezC kinrezC commented Apr 26, 2024

Copy link
Copy Markdown
Contributor
  • reintroduces the concept of fee segmentation if invariant should be pushed > 0 in a swap
  • removes the priorityFee, pool controller no longer pays a priority fee but is still able to update params

The fact that the invariant was being pushed > 0 was almost certainly the root cause of the contracts breaking. By bounding the invariant you can insure that you will not reach the boundaries of the ppf (0, 1).

* k = Φ⁻¹(y/K) - Φ⁻¹(1-x) + σ√τ
* y = KΦ(Φ⁻¹(1-x) - σ√τ + k)
* x = 1 - Φ(Φ⁻¹(y/K) + σ√τ - k)

Note that in the above invariant the y reserve increases along with K leading to a scenario where the curve is trivially pushed to Φ⁻¹(y/K) where y > K thus breaching the ppf bounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant